package com.spddr.pmos.cxf.impl;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;

import com.spddr.pmos.cxf.JaxrsTrade;
import com.spddr.pmos.jpa.Trade;
import com.spddr.pmos.pojo.TradeResultPivot;
import com.spddr.pmos.repos.CompanyRepos;
import com.spddr.pmos.repos.CustomerRepos;
import com.spddr.pmos.repos.GridRepos;
import com.spddr.pmos.repos.OrganizationRepos;
import com.spddr.pmos.repos.TradeRepos;

@Service
public class JaxrsTradeImpl extends AbstractJaxrsAllObjImpl<Trade> implements JaxrsTrade {
	@Autowired
	private TradeRepos repository;
	@Autowired
	private GridRepos gridRepos;
	@Autowired
	private CompanyRepos companyRepos;
	@Autowired
	private CustomerRepos customerRepos;
	@Autowired
	private OrganizationRepos organizationRepos;

	@Override
	public JpaRepository<Trade, Long> getRepository() {
		return repository;
	}

	@Override
	public List<TradeResultPivot> tradeResult(long tradeId, long saler) {
		// gridRepos.findAll().stream().forEach(x -> {
		//
		// });

		// organizationRepos.findAll().stream().forEach(action);
		return null;
	}

	@Override
	public List<String> myTest() {
		// TODO Auto-generated method stub
		List<String> list = new ArrayList<String>();
		list.add("one");
		list.add("two");
		list.add("three");
		list.add("four");
		System.out.println(list);
		return list;
	}

}
